package com.hiyu.dome3;


/*public class java04 {
    public static void main(String[] args) {
        int count  = 0;
        Random r = new Random();

        int number = r.nextInt(100) + 1;
        System.out.println(number);
        Scanner sc = new Scanner(System.in);
        while (true) {
            System.out.println("请输入你要猜的数字");
            int guess = sc.nextInt();
            count++;
            if(count==3){
                System.out.println("猜中了");
                break;
            }
            if (guess > number) {
                System.out.println("猜大了");
            } else if (guess < number) {
                System.out.println("猜小了");
            } else {
                System.out.println("猜中了");
                break;
            }
        }
    }
}

public class java04 {
    public static void main(String[] args) {
        int arr[] = new int[]{11, 12, 12};
        double arr1[] = {11, 12, 13};
        int arr3[] = {3, 4};
        String arr4[] = {"zhangsan", "lisi"};
        String arr5[] = new String[]{"zhangcan", "lisi"};
        double arr6[] = new double[]{1.54, 1.93};
        System.out.println(arr6);
        int number = arr[0];
        System.out.println(number);
        System.out.println(arr[1]);
        arr[0] = 100;
        System.out.println(arr[0]);

    }

}

public class java04{
    public static void main(String[] args) {
        int arr[]={1,2,3,4,5};
        for (int i = 0; i < arr.length; i++) {
            System.out.println(arr[i]);
        }
    }
}

public class java04{
    public static void main(String[] args) {
        int arr[]={1,2,3,4,5};
        int sum = 0;
        for (int i = 0; i < arr.length; i++) {
            sum+=arr[i];
        }
        System.out.println(sum);
    }
}

public class java04{
    public static void main(String[] args) {
        int arr[]={1,2,3,4,5,6,7,8,9,10};
        int count  = 0;
        for (int i = 0; i < arr.length; i++) {
            if(arr[i]%3==0)
                count++;
        }
        System.out.println("能被3整除的数为"+count+"个");
    }
}

public class java04 {
    public static void main(String[] args) {
        int arr[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
        for (int i = 0; i < arr.length; i++) {
            if (arr[i] % 2 != 0) {
                arr[i] *= 2;
            } else {
                arr[i] /= 2;
            }
        }
        for (int i = 0; i < arr.length; i++) {
            System.out.println(arr[i]);
        }
    }
}

public class java04{
    public static void main(String[] args) {
        int arr[]=new int[3];
        String arr1[]=new String[50];
        arr1[0] = "zhangcsna";
        arr1[1]="lis";
        System.out.println(arr1[0]);
        System.out.println(arr1[1]);
        System.out.println(arr1[2]);
        int arr2[] = new int[3];
        System.out.println(arr2[0]);
        System.out.println(arr2[1]);
    }
}

public class java04{
    public static void main(String[] args) {
        int arr[]={33,5,22,44,55};
        int min = arr[0];
        for (int i = 1; i < arr.length; i++) {
            if(arr[i]<min){
                min= arr[i];
            }
        }
        System.out.println(min);

    }
}

public class java04 {
    public static void main(String[] args) {
        int arr[] = new int[10];
        Random r = new Random();
        for (int i = 0; i < arr.length; i++) {
            int number = r.nextInt(100) + 1;
            arr[i] = number;
        }

        int sum = 0;
        for (int i = 0; i < arr.length; i++) {
            sum += arr[i];
        }
        System.out.println("所有数字的和为" + sum);
        double avg = sum * 1.0 / arr.length;
        System.out.println("数组的平均数为" + avg);
        int count = 0;
        for (int i = 0; i < arr.length; i++) {
            if (arr[i] < avg) {
                count++;
            }
        }
        System.out.println(count);
        for (int i = 0; i < arr.length; i++) {
            System.out.print(arr[i]+" ");
        }
    }
}

public class java04{
    public static void main(String[] args) {
       int arr[]={1,2,3,4,5};
        for (int i = 0,j = arr.length-1; i <=j ; i++,j--) {
            int temp = arr[i] ;
            arr[i] = arr[j];
            arr[j] = temp;
        }
        for (int i = 0; i < arr.length; i++) {
            System.out.print(arr[i]+" ");
        }
    }
}

public class java04 {
    public static void main(String[] args) {
        int arr[] = {1, 2, 3, 4, 5};
        Random r = new Random();
        int random = r.nextInt(arr.length);
        for (int i = 0; i < arr.length; i++) {
            int temp = arr[i];
            arr[i] = arr[random];
            arr[random] = temp;
        }
        for (int i = 0; i < arr.length; i++) {
            System.out.print(arr[i] + " ");
        }
    }
}
*/
